package com.usian.feign;

import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import com.usian.utils.Result;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "usian-content-service")
public interface ContentServiceFeign {

    /**
     * 内容管理分类查询
     *
     * @param id
     * @return
     */
    @RequestMapping("service/contentCategory/selectContentCategoryByParentId")
    public List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Integer id);

    /**
     * 内容管理分类添加
     *
     * @param parentId
     * @param name
     * @return
     */
    @RequestMapping("service/contentCategory/insertContentCategory")
    public Integer insertContentCategory(@RequestParam Integer parentId, @RequestParam String name);

    /**
     * 修改内容分类管理
     *
     * @param id
     * @param name
     * @return
     */
    @RequestMapping("service/contentCategory/updateContentCategory")
    public Integer updateContentCategory(@RequestParam Integer id, @RequestParam String name);

    /**
     * 删除内容分类管理
     *
     * @param categoryId
     * @return
     */
    @RequestMapping("service/contentCategory/deleteContentCategoryById")
    public Integer deleteContentCategoryById(@RequestParam Integer categoryId);

    /**
     * 查询广告先信息
     *
     * @return
     */
    @RequestMapping("service/contentCategory/selectTbContentAllByCategoryId")
    public PageResult selectTbContentAllByCategoryId(@RequestParam
                                                         Integer page, @RequestParam Integer rows,@RequestParam Long categoryId);


    @PostMapping("/service/contentCategory/insertTbContent")
    Integer insertTbContent(@RequestBody TbContent tbContent);


    /**
     * 查询首页大广告位
     */
    @RequestMapping("service/contentCategory/selectFrontendContentByAD")
    public List<AdNode> selectFrontendContentByAD();

}